Microprocessors are general-purpose processors that provide high instruction throughputs in order to execute software running thereon, and can have a wide range of processing requirements depending on the particular software applications involved. Many different types of processors are known, of which microprocessors are but one example. For example, Digital Signal Processors (DSPs) are widely used, in particular for specific applications, such as mobile processing applications. DSPs are typically configured to optimize the performance of the applications concerned and to achieve this they employ more specialized execution units and instruction sets. Particularly in applications such as mobile telecommunications, but not exclusively, it is desirable to provide ever increasing DSP performance while keeping power consumption as low as possible.
When programming time-critical high-computational tasks, it is often necessary to repeat the same operation many times. For example, in a DSP described in U.S. Pat. No. 4,713,749, a repeat instruction (RPT) provides for code compacting and reducing the branch overheads. The repeat feature allows a single instruction to be performed up to N+1 times. In this embodiment, N is defined by an eight-bit repeat counter RPTC, which is loaded by the RPT or RPTK instructions via a data bus with either a data memory value (via an RPT instruction) or an immediate value (RPTK instruction). The value of this operand is one less than the number of times that the next instruction is executed. The instruction immediately following is then executed, and the RPTC register is decremented until it reaches zero. When using the repeat feature, the instruction being repeated is fetched only once. As a result, many multicycle instructions become one or two cycle when they are repeated. The repeat feature can be used with instructions such as multiply/accumulates (MACD), block moves, I/O transfers, and table read/writes. Those instructions that are normally multicycle are pipelined when using the repeat feature, and effectively become single-cycle instructions. Programs, such as filter implementation, require loops that can be controlled in as little time as possible. For example, a 50-tap transversal filter code can be defined by two instructions, RPTK 49 and MACD.
In certain digital signal processors, hardware is provided which will repeat a block of code a specified number of times, with zero cycle overhead after the first iteration through the block of code. In all cases to date, this hardware can only work on one block of code at a time and nesting is only supported if registers are manually saved, which is inefficient in cycles.